////////////////////////////////////
// Win32WrapperClass			  //
//                                //
// File: PortScannerWindow.h      // 
// Desc: Declaration of the       //
//			PortScannerWindow     //
//			class.				  //
////////////////////////////////////

#ifndef _PORTSCANNERWINDOW_H_
#define _PORTSCANNERWINDOW_H_

#include "Main.h"
#include "Win32WrapperClass.h"

class PortScannerWindow: public Win32WrapperClass {
public:
	PortScannerWindow(char *ClassName, char *WindowTitle, DWORD dwStyles, RECT *rect, HMENU hMenu, HINSTANCE hInstance);
	virtual ~PortScannerWindow();

	LRESULT CALLBACK WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
	void BuildGUI();
	char* GrabTextFromEdit(int nResourceID);
	BOOL validateInput();
	BOOL goScan();
	BOOL Regionize();
	BOOL Skin(HDC dc);
	BOOL Unskin();
	HWND getHWND();

protected:
	HWND m_hGoButton;
	HWND m_hIPAddressEdit;
	HWND m_hStartPortEdit;
	HWND m_hEndPortEdit;
	HWND m_hIPAddressLabel;
	HWND m_hStartPortLabel;
	HWND m_hEndPortLabel;
	HWND m_hDisplayArea;
	HWND m_hCloseButton;
	HWND m_hUnskinButton;
	HWND m_hUnskinButtonTT;
	HWND m_hOutputGroup;
	HWND m_hEditGroup;
	HWND m_hShowOpenCheckBx;
	HWND m_hShowClosedCheckBx;

	// Handle to our scan thread
	HANDLE m_hThread;

	// Our scanning flag - true if the scan thread is active
	BOOL m_bScanFlag;
	BOOL m_bSkinned;

	// Our output flags - true if (open|closed) display is on
	BOOL m_bShowOpen;
	BOOL m_bShowClosed;

	// thread function
	static DWORD WINAPI ThreadProc(LPVOID pvoid);
	char* ResolveDNS(char *unresolvedIP);
};

#endif // _PORTSCANNERWINDOW_H_